/**
 * 
 */
package edu.hm.compiler.scanner.token;

/**
 * @author Saruman
 */
public class ErrorToken implements IToken
{
    private final String            pattern;

    public static final ITokenClass EOF_TOKEN_CLASS = new TokenClass( "EOF" ); //$NON-NLS-1$

    public ErrorToken( String pattern )
    {
        this.pattern = pattern;
    }

    /*
     * (non-Javadoc)
     * @see edu.hm.compiler.token.IToken#getTokenClass()
     */
    @Override
    public ITokenClass getTokenClass()
    {
        return EOF_TOKEN_CLASS;
    }

    /*
     * (non-Javadoc)
     * @see edu.hm.compiler.token.IToken#getPattern()
     */
    @Override
    public String getPattern()
    {
        return this.pattern;
    }

    /*
     * (non-Javadoc)
     * @see edu.hm.compiler.token.IToken#getLine()
     */
    @Override
    public int getLine()
    {
        return -1;
    }

    /*
     * (non-Javadoc)
     * @see edu.hm.compiler.token.IToken#getCharPos()
     */
    @Override
    public int getCharPos()
    {
        // TODO Auto-generated method stub
        return -1;
    }

    @Override
    public String toString()
    {
        return "EOFToken[pattern=" + this.pattern + "]"; //$NON-NLS-1$ //$NON-NLS-2$
    }
}
